﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Pot0a01
    {
        private int? _levercode;
		private string _levername;
		private string _plevercode;
		private string _muser;
		private string _listid;
		private string _status;
		private string _tmp1;
		private string _tmp2;
		
        /// <summary>
        /// 结构代码
        /// </summary>
		public int? Levercode
		{
			get { return _levercode;	 }
			set { _levercode=value;	}
		}
        /// <summary>
        /// 结构名称
        /// </summary>
		public string Levername
		{
			get { return _levername;	 }
			set { _levername=value;	}
		}
        /// <summary>
        /// 父级结构代码
        /// </summary>
		public string Plevercode
		{
			get { return _plevercode;	 }
			set { _plevercode=value;	}
		}
        /// <summary>
        /// 用户标识
        /// </summary>
		public string Muser
		{
			get { return _muser;	 }
			set { _muser=value;	}
		}
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Status
		{
			get { return _status;	 }
			set { _status=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Tmp1
		{
			get { return _tmp1;	 }
			set { _tmp1=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Tmp2
		{
			get { return _tmp2;	 }
			set { _tmp2=value;	}
		}
		
		public static List<Pot0a01> GetPot0a01ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Pot0a01> list = new List<Pot0a01>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Pot0a01 model = GetPot0a01ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Pot0a01 GetPot0a01ByDataRow(DataRow dr)
		{
			Pot0a01 model = new Pot0a01(); //实例化Pot0a01
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("levercode")&&!(dr["levercode"] is System.DBNull))  
				model.Levercode = ( int)dr["levercode"];
			if (dcc.Contains("levername")&&!(dr["levername"] is System.DBNull))  
				model.Levername = ( string)dr["levername"];
			if (dcc.Contains("plevercode")&&!(dr["plevercode"] is System.DBNull))  
				model.Plevercode = ( string)dr["plevercode"];
			if (dcc.Contains("muser")&&!(dr["muser"] is System.DBNull))  
				model.Muser = ( string)dr["muser"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			if (dcc.Contains("status")&&!(dr["status"] is System.DBNull))  
				model.Status = ( string)dr["status"];
			if (dcc.Contains("tmp1")&&!(dr["tmp1"] is System.DBNull))  
				model.Tmp1 = ( string)dr["tmp1"];
			if (dcc.Contains("tmp2")&&!(dr["tmp2"] is System.DBNull))  
				model.Tmp2 = ( string)dr["tmp2"];
			
			return model;
		}
    }
}
